package com.tao.com.xiaowen.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.tao.com.xiaowen.module.jokepicture.PicJokeFragment;
import com.tao.com.xiaowen.module.joketext.TextJokeFragment;

/**
 * Created by Administrator on 2016/8/2.
 */
public class JokePagerAdapter extends FragmentPagerAdapter {

    public JokePagerAdapter(FragmentManager fm) {
        super(fm);
    }


    @Override
    public Fragment getItem(int position) {

        if (position == 0){
           return new TextJokeFragment();
        }
        if (position == 1){
            return new PicJokeFragment();
        }
        return null;
    }

    @Override
    public int getCount() {
        return 2;
    }
}
